function setCookie(name, value, date) {
    let oDate = new Date()
    oDate.setDate(oDate.getDate() + date)

    document.cookie = `${name}=${value}; expires=${oDate}`
}

function getCookie(attr) {
    let arr = document.cookie.split('; ')

    let obj = {}

    for (let i = 0; i < arr.length; i++) {
        obj[arr[i].split('=')[0]] = arr[i].split('=')[1]
    }

    return obj[attr]
}

function removeCookie(name) {
    setCookie(name, 'abc', -1)
}